package data;

import anaydis.sort.data.DataSetGenerator;
import org.jetbrains.annotations.NotNull;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;

public class IntegerDataSetGenerator implements DataSetGenerator {
    @NotNull
    public List createAscending(int i) {
        List<Integer> list = new ArrayList<Integer>();
        for(int j = 0; j < i; j++){
            list.add(j);
        }
        return list;
    }

    @NotNull
    public List createDescending(int i) {
        List<Integer> list = new ArrayList<Integer>();
        for(int j = i-1; j > -1; j--){
            list.add(j);
        }
        return list;
    }

    @NotNull
    public List createRandom(int i) {
        List randomList = createAscending(i);
        Collections.shuffle(randomList);
        return randomList;
    }

    @NotNull
    public Comparator getComparator() {
        return new IntComparator();
    }
}
